package com.aspose.cells;

final class zbk {
   private static zayx[] w = new zayx[]{new zayx(0, 0, 21600, 21600)};
   public com.aspose.cells.b.a.b.zn[] a;
   public int[] b;
   public zfh[] c;
   public int[] d;
   public zayx[] e;
   public int f;
   public int g;
   public com.aspose.cells.b.a.b.zn[] h;
   public int[] i;
   static int[] j = new int[]{0};
   static int[] k = new int[]{1400};
   static int[] l = new int[]{1800};
   static int[] m = new int[]{2500};
   static int[] n = new int[]{2700};
   static int[] o = new int[]{3600};
   static int[] p = new int[]{3700};
   static int[] q = new int[]{5400};
   static int[] r = new int[]{8100};
   static int[] s = new int[]{10800};
   static int[] t = new int[]{16200, 5400};
   static int[] u = new int[]{17694720, 0};
   static com.aspose.cells.b.a.b.zn[] v = new com.aspose.cells.b.a.b.zn[]{new com.aspose.cells.b.a.b.zn(10800, 0), new com.aspose.cells.b.a.b.zn(0, 10800), new com.aspose.cells.b.a.b.zn(10800, 21600), new com.aspose.cells.b.a.b.zn(21600, 10800)};

   zbk(com.aspose.cells.b.a.b.zn[] var1, int[] var2, zfh[] var3, int[] var4, zayx[] var5, int var6, int var7, int var8, int var9, com.aspose.cells.b.a.b.zn[] var10) {
      this(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, (int[])null);
   }

   zbk(com.aspose.cells.b.a.b.zn[] var1, int[] var2, zfh[] var3, int[] var4, zayx[] var5, int var6, int var7, int var8, int var9, com.aspose.cells.b.a.b.zn[] var10, int[] var11) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
      this.d = var4;
      if (var5 == null) {
         var5 = w;
      }

      this.e = var5;
      this.f = var6;
      this.g = var7;
      if (var10 != null) {
         this.h = var10;
      } else {
         this.h = v;
      }

      this.i = var11;
   }

   float a(short var1, int[] var2, byte[] var3) {
      if (this.c == null) {
         throw new IllegalStateException("Autoshape haven't calculation data");
      } else {
         int var4 = this.c[var1].a;
         int[] var5 = new int[]{this.c[var1].b, this.c[var1].c, this.c[var1].d};
         double[] var6 = new double[]{(double)this.c[var1].b, (double)this.c[var1].c, (double)this.c[var1].d};

         for(int var7 = 0; var7 < 3; ++var7) {
            if ((var4 & 8192 << var7) != 0) {
               if ((var5[var7] & 1024) != 0) {
                  var6[var7] = (double)this.a((short)(var5[var7] & 255), var2, var3);
               } else {
                  switch(var5[var7]) {
                  case 320:
                     var6[var7] = 0.0D;
                     var3[0] = (byte)(var3[0] | 1);
                     break;
                  case 321:
                     var6[var7] = 0.0D;
                     var3[0] = (byte)(var3[0] | 4);
                     break;
                  case 322:
                     var6[var7] = (double)this.f;
                     var3[0] = (byte)(var3[0] | 2);
                     break;
                  case 323:
                     var6[var7] = (double)this.g;
                     var3[0] = (byte)(var3[0] | 8);
                     break;
                  case 324:
                  case 325:
                  case 326:
                  default:
                     var6[var7] = 0.0D;
                     break;
                  case 327:
                  case 328:
                  case 329:
                  case 330:
                  case 331:
                  case 332:
                  case 333:
                  case 334:
                  case 335:
                  case 336:
                     try {
                        var6[var7] = (double)var2[var5[var7] - 327];
                     } catch (IndexOutOfBoundsException var9) {
                        ;
                     }
                  }
               }
            }
         }

         switch(var4 & 255) {
         case 0:
            var6[0] += var6[1] - var6[2];
            break;
         case 1:
            if (var6[1] != 0.0D) {
               var6[0] *= var6[1];
            }

            if (var6[2] != 0.0D) {
               var6[0] /= var6[2];
            }
            break;
         case 2:
            var6[0] = (var6[0] + var6[1]) / 2.0D;
            break;
         case 3:
            var6[0] = Math.abs(var6[0]);
            break;
         case 4:
            if (var6[0] > var6[1]) {
               var6[0] = var6[1];
            }
            break;
         case 5:
            if (var6[0] < var6[1]) {
               var6[0] = var6[1];
            }
            break;
         case 6:
            if (var6[0] > 0.0D) {
               var6[0] = var6[1];
            } else {
               var6[0] = var6[2];
            }
            break;
         case 7:
            var6[0] = Math.sqrt(var6[0] * var6[0] + var6[1] * var6[1] + var6[2] * var6[2]);
            break;
         case 8:
            var6[0] = zanc.b(Math.atan2(var6[1], var6[0])) * 65536.0D;
            break;
         case 9:
            var6[0] *= Math.sin(zanc.a(var6[1]) / 65536.0D);
            break;
         case 10:
            var6[0] *= Math.cos(zanc.a(var6[1]) / 65536.0D);
            break;
         case 11:
            var6[0] *= Math.cos(Math.atan2(var6[2], var6[1]));
            break;
         case 12:
            var6[0] *= Math.sin(Math.atan2(var6[2], var6[1]));
            break;
         case 13:
            var6[0] = Math.sqrt(var6[0]);
            break;
         case 14:
            var6[0] += (var6[1] - var6[2]) * 65536.0D;
            break;
         case 15:
            if (var6[1] != 0.0D) {
               var6[0] /= var6[1];
               var6[0] = var6[2] * Math.sqrt(1.0D - var6[0] * var6[0]);
            }
            break;
         case 16:
            var6[0] *= Math.tan(var6[1]);
            break;
         case 128:
            if (var6[2] == 0.0D) {
               var6[0] = Math.sqrt(var6[0] * var6[0] + var6[1] * var6[1]);
            } else {
               if (var6[0] == 0.0D) {
                  var6[0] = var6[1];
               }

               var6[0] = Math.sqrt(var6[2] * var6[2] - var6[0] * var6[0]);
            }
            break;
         case 129:
            var6[2] *= 0.0017453292519943296D;
            var6[0] = 10800.0D + Math.cos(var6[2]) * (var6[0] - 10800.0D) + Math.sin(var6[2]) * (var6[1] - 10800.0D);
            break;
         case 130:
            var6[2] *= 0.0017453292519943296D;
            var6[0] = 10800.0D - Math.sin(var6[2]) * (var6[0] - 10800.0D) + Math.cos(var6[2]) * (var6[1] - 10800.0D);
         }

         return (float)var6[0];
      }
   }
}
